package com.rankeiot.platform.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.FieldNameConstants;
import org.hibernate.validator.constraints.Length;
import org.sagacity.sqltoy.config.annotation.Column;
import org.sagacity.sqltoy.config.annotation.Entity;
import org.sagacity.sqltoy.config.annotation.Id;

import java.io.Serializable;
import java.sql.Types;

/**
 * 微信用户
 * @author desire
 */
@Schema(description = "微信用户")
@Data
@FieldNameConstants(asEnum = true)
@Entity(tableName=WxUser.TABLE)
public class WxUser  implements Serializable {
    public static final String TABLE="t_user_wx";
    @Schema(description = "ID")
    @Id
    @NotNull
    @Column(name="user_id",length=20L,type= Types.BIGINT,nullable=false)
    private Long userId;

    @Schema(description = "UnionID")
    @NotNull
    @Length(max=50)
    @Column(name="union_id",length=50L,type=Types.VARCHAR)
    private String unionId;

    @Schema(description = "OpenID")
    @NotNull
    @Length(max=50)
    @Column(name="openid",length=50L,type=Types.VARCHAR)
    private String openid;

    @Schema(description = "用户昵称")
    @Length(max=200)
    @Column(name="nickname",length=200L,type=Types.VARCHAR)
    private String nickname;

    @Schema(description = "sex")
    @Length(max=20)
    @Column(name="sex",length=20L,type=Types.VARCHAR)
    private String sex;

    @Schema(description = "province")
    @Length(max=100)
    @Column(name="province",length=100L,type=Types.VARCHAR)
    private String province;

    @Schema(description = "city")
    @Length(max=100)
    @Column(name="city",length=100L,type=Types.VARCHAR)
    private String city;

    @Schema(description = "country")
    @Length(max=100)
    @Column(name="country",length=100L,type=Types.VARCHAR)
    private String country;

    @Schema(description = "headimgurl")
    @Length(max=200)
    @Column(name="headimgurl",length=200L,type=Types.VARCHAR)
    private String headimgurl;

    @Schema(description = "privilege")
    @Length(max=5000)
    @Column(name="privilege",length=5000L,type=Types.VARCHAR)
    private String privilege;
}
